package cn.tedu.controller;

import cn.tedu.pojo.car;
import cn.tedu.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("car")
@CrossOrigin
public class CarController {
    @Autowired
    private CarService carService;
    @RequestMapping("get")
    public List<car> get(){
        return carService.selectlist();
    }
    @RequestMapping("getById")
    public List<car> getById(Integer id) {
        return carService.selectById(id);
    }
    @RequestMapping("insert")
    public void insert(car car){
        carService.insert(car);
    }
}
